package com.sky.base.exception;

/**
 * @author 尹稳健~
 * @version 1.0
 * @time 2023/6/10
 */
public class MyException extends RuntimeException {
    private String errMessage;

    public MyException() {
        super();
    }

    public MyException(String errMessage) {
        super(errMessage);
        this.errMessage = errMessage;
    }

    public String getErrMessage() {
        return errMessage;
    }

    public void setErrMessage(String errMessage) {
        this.errMessage = errMessage;
    }

    public static void cast(CommonError commonError){
        throw new MyException(commonError.getErrMessage());
    }

    public static void cast(String errMessage){
        throw new MyException(errMessage);
    }
}
